<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		<div width:1024px;margin:auto;>
			<div  height:100px;line-height: 100px;font-size:32px;text-align: center;>
				<center>购物车</center>
			</div>
			<div font-size:12px;font-family:'Microsoft YaHei';color:#333;>
				<table border='1' width:48px;height:22px;>
					<thead>
						<tr>
							<th width:10%;>
								<input type="checkbox" id="chAll">
								<label for="ye">全选</label>
							</th>
							<th width:30%;>商品</th>
							<th width:20%;>商品名称</th>
							<th width:10%;>单价</th>
							<th width:20%;>数量</th>
							<th width:20%;>小计</th>
							<th width:20%;>操作</th>
						</tr>
					</thead>
				</table>
			</div>
			<div id="">
				
			</div>
		</div>
	</body>
	<script type="text/javascript">
		/*function fun(){
			document.write("<center>购物车</center>&nbsp");
			document.write("<table border='1' style='align:center;width:500px;height:30px'>");
			document.write("<tr><th>全选<input type='checkbox' value='' name=''/></th><th>商品</th><th>商品名称</th><th>单价</th><th>数量</th><th>小计</th><th>操作</th></tr>")
			document.write("<tr><th><input type='checkbox' value='' name=''/></th><th></th><th>商品-1</th><th></th><th></th><th></th><th>"+"<input type='button' id='button1' value='删除'></input>"+"</th></tr>")
			document.write("<tr><th><input type='checkbox' value='' name=''/></th><th></th><th>商品-2</th><th></th><th><th></th></th><th>"+"<input type='button' id='button2' value='删除'></input>"+"</th></tr>")
			document.write("<tr><th></th><th></th><th></th><th></th><th>总计:</th><th>去结算</th></tr>")
			document.write("</table>");
			
			var tr = document.createElement('tr');
	        // 复选框
	        var tdCheckbox = document.createElement('td');
	        tr.appendChild(tdCheckbox);
	
	        var chk = document.createElement('input');
	        chk.type = 'checkbox';
	        chk.checked = true;
	        tdCheckbox.appendChild(chk);
		}*/
		var carts = [
		    {name:'商品-1' , price:12 , amount:2 , img:'html5.jpg'},
		    {name:'商品-2' , price:20 , amount:3 , img:'javascript.jpg'},
		    {name:'商品-3' , price:35 , amount:1 , img:'mobile.jpg'}
		];
		window.onload = function(){
    	// 遍历数组，加载数据
    		loadData();
		}
		fun();
	</script>
</html>
